import { request } from '@/utils/request'
import type { Token, User } from '@/types/user'

// 登录
export const login = (data: { loginname: string; password: string }) => {
  return request<Token>({
    url: 'user/login',
    method: 'POST',
    data
  })
}

// 获取用户信息
export const getUserInfo = () => {
  return request<User>({
    url: 'user/info'
  })
}
